home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / MODULA_2 / 2394.ZIP / M2TOOLS1.ZIP / PRINTERO.DEF < prev    next >
Text File  |  1990-08-08  |  3KB  |  98 lines

  1. DEFINITION MODULE PrinterOps;
  2.  
  3.   TYPE
  4.     TypeFaceType  = (Expanded, Condensed, Italic, NLQ, Bold, Emphasis,
  5.                      Proportional, Underlined, Superscript, Subscript);
  6.     PitchType     = (Pica, Elite);
  7.     AlignmentType = (Left, Centre, Right);
  8.     MarginType    = (TopMargin, BottomMargin, LeftMargin, RightMargin);
  9.  
  10.   PROCEDURE PWrite (Ch : CHAR);
  11.  
  12.     (* Prints a character on the printer *)
  13.  
  14.   PROCEDURE PWriteCard (Card,
  15.                         Width : CARDINAL);
  16.  
  17.     (* Prints a cardinal number on the printer *)
  18.  
  19.   PROCEDURE PWriteInt (Int,
  20.                        Width : INTEGER);
  21.  
  22.     (* Prints an integer number on the printer *)
  23.  
  24.  
  25.   PROCEDURE PRept (Char : CHAR;
  26.                    No   : CARDINAL);
  27.  
  28.     (* This procedure will print Char No times on the printer *)
  29.  
  30.   PROCEDURE PWriteLn;
  31.  
  32.     (* This procedure will advance the printer head one line and back to
  33.        the left hand side *)
  34.  
  35.   PROCEDURE PWriteString (String : ARRAY OF CHAR);
  36.  
  37.     (* Prints a string of characters to the printer *)
  38.  
  39.   PROCEDURE SetTypeFace (TypeFace : TypeFaceType);
  40.  
  41.     (* Changes the typeface to one of the ones above (from TypeFaceType).
  42.        e.g. SetTypeFace (Italic)
  43.  
  44.        In order to achieve, for example, bold italic, you would need to
  45.        have two calls of this procedure - one with bold and one with italic,
  46.        in any order. *)
  47.  
  48.   PROCEDURE SetPitch (Pitch : PitchType);
  49.  
  50.     (* Choose the Pitch from the PitchTypes above.
  51.        e.g. SetPitch (Elite)    *)
  52.  
  53.   PROCEDURE CancelTypeFace (TypeFace : TypeFaceType);
  54.  
  55.     (* Select TypeFace from TypeFaceType above.
  56.        e.g. CancelTypeFace (Italic)
  57.  
  58.        If you were currently printing in bold italic and wanted to just print
  59.        bold then use the example above (3 lines up) *)
  60.  
  61.   PROCEDURE SetAlignment (Alignment : AlignmentType);
  62.  
  63.     (* e.g. SetAlignment (Right) will justify all printing to the right *)
  64.  
  65.   PROCEDURE EjectPage;
  66.  
  67.     (* Best used to make sure all the text sent to the printer is actually
  68.        printed, as text is stored in the printer's buffer until an EOL
  69.        character is received.  Used most at the end of each page. *)
  70.  
  71.   PROCEDURE ResetPrinter;
  72.  
  73.     (* This cancels any settings that have been made, e.g. margin settings, or
  74.        type face settings.  It also resets the top of page to be the line the
  75.        printer head is on *)
  76.  
  77.   PROCEDURE SetPageLength (PageLength : ARRAY OF CHAR);
  78.  
  79.     (* In Inches *)
  80.  
  81.   PROCEDURE SetPageLines  (PageLines  : ARRAY OF CHAR);
  82.  
  83.     (* In Lines *)
  84.  
  85.   PROCEDURE SetMargin (Margin : MarginType;
  86.                        Width  : ARRAY OF CHAR);
  87.  
  88.     (* In lines not inches.
  89.  
  90.        Choose Margin from MarginType at the top *)
  91.  
  92.   PROCEDURE LargeChars (Code : CHAR);
  93.  
  94.     (*  0 - Cancel enlargement
  95.         1 - Double high, double wide
  96.         2 - Quadruple high, quadruple wide *)
  97.  
  98. END PrinterOps.